Start by loading the various libraries and packages we will be using.
The “Pacman” package will automatically install any packages you do not currently have installed and load the applicable libraries.
if (!require("pacman")) install.packages("pacman")
pacman::p_load(leaflet, sp, sf, shapefiles, rgdal, geojsonio, geojsonR, spatialEco, maptools, dyplr, curl)
This dataset is a subset of the Killed and Seriously Injured (KSI) dataset collected by the Toronto Police Service from 2008-2018. These events include any serious or fatal collisions where a Pedestrian is involved. To learn more about Pedestrians related collisions in Toronto you can follow this link: http://data.torontopolice.on.ca/pages/pedestrians
We will use the FROM_GeoJson command from the “geojsonR” package to download a json file from the provided URL. The geojson_read command from the “geojsonio” and formating form the “sp” package can then be used to read the json and generate a SpatialPointsDataFrame
json_ped <- FROM_GeoJson("https://opendata.arcgis.com/datasets/3dedc9bff625450990b8d480f397ad3f_0.geojson")
ksi_ped <- geojsonio::geojson_read("https://opendata.arcgis.com/datasets/3dedc9bff625450990b8d480f397ad3f_0.geojson", what = "sp")
head(ksi_ped)
This dataset is a subset of the Killed and Seriously Injured (KSI) dataset collected by the Toronto Police Service from 2008-2018. These events include any serious or fatal collision involving an operator or passenger of a TTC, Transit Vehicle, streetcar or Municipal Vehicle. To learn more about TTC-Municipal Vehicle related collisions in Toronto you can follow this link: http://data.torontopolice.on.ca/pages/ttc-municipal-vehicle
We will use the FROM_GeoJson command from the “geojsonR” package to download a json file from the provided URL. The geojson_read command from the “geojsonio” and formating form the “sp” package can then be used to read the json and generate a SpatialPointsDataFrame
json_ttc <- FROM_GeoJson("https://opendata.arcgis.com/datasets/dc4751278e604d65b0886b9765d4b551_0.geojson")
ksi_ttc <- geojsonio::geojson_read("https://opendata.arcgis.com/datasets/dc4751278e604d65b0886b9765d4b551_0.geojson", what = "sp")
head(ksi_ttc)
As you will have noticed from the descritpions both the KSI_PED and KSI_TTC datasets are themselves subsets of the Toronto Police Services’ KSI Dataset. We downloaded them as seperate dataframes to enable faster downloads as they make up a small portion of the full KSI dataset, which would take significantly more time to download and sort. Because they come from the same base dataset and have the same schema we can merge them back into one dataframe to work with. We will merge them based on the “Index” to ensure there are no duplicates created due to the merging process.
ksi_merged <- merge(ksi_ped,ksi_ttc, by="Index")
The City of Toronto also maintains a list that defines the boundaries of all the neighbourhoods in the city. A file containing the spatial data required to map these neighbourhoods can be downloaded form the City of Toronto open data portal. Due to how this file will download, unlike the KSI data, we cannot directly read the GeoJson file but have to download it before the file can be read.
set_wd <- function() {
library(rstudioapi) # make sure you have it installed
current_path <- getActiveDocumentContext()$path
setwd(dirname(current_path))
print( getwd() )
}
download.file("https://ckan0.cf.opendata.inter.prod-toronto.ca/download_resource/a083c865-6d60-4d1d-b6c6-b0c8a85f9c15?format=geojson&projection=4326", destfile = "datasets/Neighbourhoods.geojson", )
trying URL 'https://ckan0.cf.opendata.inter.prod-toronto.ca/download_resource/a083c865-6d60-4d1d-b6c6-b0c8a85f9c15?format=geojson&projection=4326'
Content type 'application/json' length unknown
downloaded 1.9 MB
nbh <- geojsonio::geojson_read("datasets/Neighbourhoods.geojson", what = "sp")
head(nbh)
An object of class "SpatialPolygonsDataFrame"
Slot "data":
Slot "polygons":
[[1]]
An object of class "Polygons"
Slot "Polygons":
[[1]]
An object of class "Polygon"
Slot "labpt":
[1] -79.42551 43.67692
Slot "area":
[1] 0.0001878122
Slot "hole":
[1] FALSE
Slot "ringDir":
[1] 1
Slot "coords":
[,1] [,2]
[1,] -79.43592 43.68015
[2,] -79.43492 43.68037
[3,] -79.43395 43.68058
[4,] -79.43388 43.68059
[5,] -79.43282 43.68081
[6,] -79.43270 43.68080
[7,] -79.43253 43.68083
[8,] -79.43246 43.68086
[9,] -79.43241 43.68090
[10,] -79.43095 43.68121
[11,] -79.42909 43.68160
[12,] -79.42903 43.68145
[13,] -79.42786 43.68169
[14,] -79.42634 43.68202
[15,] -79.42640 43.68216
[16,] -79.42629 43.68219
[17,] -79.42619 43.68196
[18,] -79.42471 43.68230
[19,] -79.42458 43.68232
[20,] -79.42466 43.68250
[21,] -79.42386 43.68266
[22,] -79.42355 43.68272
[23,] -79.42355 43.68271
[24,] -79.42343 43.68273
[25,] -79.42336 43.68258
[26,] -79.42274 43.68271
[27,] -79.42214 43.68283
[28,] -79.42153 43.68296
[29,] -79.42069 43.68313
[30,] -79.42072 43.68316
[31,] -79.42027 43.68326
[32,] -79.41973 43.68337
[33,] -79.41913 43.68350
[34,] -79.41849 43.68363
[35,] -79.41843 43.68350
[36,] -79.41830 43.68317
[37,] -79.41827 43.68310
[38,] -79.41812 43.68271
[39,] -79.41781 43.68193
[40,] -79.41770 43.68163
[41,] -79.41767 43.68157
[42,] -79.41748 43.68105
[43,] -79.41709 43.68010
[44,] -79.41698 43.67982
[45,] -79.41676 43.67925
[46,] -79.41658 43.67878
[47,] -79.41644 43.67833
[48,] -79.41579 43.67673
[49,] -79.41553 43.67607
[50,] -79.41485 43.67434
[51,] -79.41469 43.67391
[52,] -79.41675 43.67347
[53,] -79.41711 43.67340
[54,] -79.41963 43.67288
[55,] -79.42182 43.67242
[56,] -79.42185 43.67242
[57,] -79.42293 43.67221
[58,] -79.42697 43.67144
[59,] -79.42940 43.67097
[60,] -79.43295 43.67029
[61,] -79.43301 43.67027
[62,] -79.43318 43.67071
[63,] -79.43334 43.67111
[64,] -79.43448 43.67388
[65,] -79.43465 43.67429
[66,] -79.43378 43.67441
[67,] -79.43393 43.67475
[68,] -79.43404 43.67504
[69,] -79.43410 43.67517
[70,] -79.43451 43.67618
[71,] -79.43483 43.67693
[72,] -79.43527 43.67799
[73,] -79.43555 43.67868
[74,] -79.43573 43.67910
[75,] -79.43591 43.67955
[76,] -79.43569 43.67959
[77,] -79.43586 43.68002
[78,] -79.43592 43.68015
Slot "plotOrder":
[1] 1
Slot "labpt":
[1] -79.42551 43.67692
Slot "ID":
[1] "0"
Slot "area":
[1] 0.0001878122
[[2]]
An object of class "Polygons"
Slot "Polygons":
[[1]]
An object of class "Polygon"
Slot "labpt":
[1] -79.40359 43.70469
Slot "area":
[1] 0.0001843636
Slot "hole":
[1] FALSE
Slot "ringDir":
[1] 1
Slot "coords":
[,1] [,2]
[1,] -79.41096 43.70408
[2,] -79.40962 43.70436
[3,] -79.40852 43.70460
[4,] -79.40857 43.70469
[5,] -79.40864 43.70489
[6,] -79.40872 43.70504
[7,] -79.40881 43.70519
[8,] -79.40891 43.70528
[9,] -79.40897 43.70532
[10,] -79.40903 43.70536
[11,] -79.40916 43.70542
[12,] -79.40930 43.70548
[13,] -79.40943 43.70555
[14,] -79.40954 43.70563
[15,] -79.40962 43.70574
[16,] -79.40970 43.70583
[17,] -79.40974 43.70593
[18,] -79.40976 43.70601
[19,] -79.40975 43.70608
[20,] -79.40997 43.70690
[21,] -79.41016 43.70771
[22,] -79.41021 43.70795
[23,] -79.41027 43.70818
[24,] -79.41036 43.70838
[25,] -79.41041 43.70852
[26,] -79.41044 43.70857
[27,] -79.41078 43.70946
[28,] -79.41113 43.71033
[29,] -79.41149 43.71119
[30,] -79.40929 43.71164
[31,] -79.40758 43.71201
[32,] -79.40594 43.71238
[33,] -79.40572 43.71242
[34,] -79.40375 43.71284
[35,] -79.40166 43.71329
[36,] -79.39984 43.71365
[37,] -79.39982 43.71353
[38,] -79.39972 43.71300
[39,] -79.39956 43.71229
[40,] -79.39948 43.71184
[41,] -79.39932 43.71108
[42,] -79.39929 43.71091
[43,] -79.39900 43.70958
[44,] -79.39887 43.70909
[45,] -79.39868 43.70821
[46,] -79.39863 43.70799
[47,] -79.39837 43.70673
[48,] -79.39824 43.70614
[49,] -79.39785 43.70435
[50,] -79.39783 43.70415
[51,] -79.39768 43.70340
[52,] -79.39767 43.70329
[53,] -79.39751 43.70251
[54,] -79.39734 43.70179
[55,] -79.39722 43.70114
[56,] -79.39716 43.70085
[57,] -79.39704 43.70030
[58,] -79.39695 43.69979
[59,] -79.39686 43.69933
[60,] -79.39664 43.69830
[61,] -79.39647 43.69737
[62,] -79.39620 43.69613
[63,] -79.39611 43.69566
[64,] -79.39688 43.69560
[65,] -79.39720 43.69565
[66,] -79.39804 43.69585
[67,] -79.39896 43.69610
[68,] -79.40009 43.69639
[69,] -79.40127 43.69673
[70,] -79.40167 43.69683
[71,] -79.40228 43.69700
[72,] -79.40258 43.69707
[73,] -79.40277 43.69713
[74,] -79.40296 43.69715
[75,] -79.40312 43.69726
[76,] -79.40320 43.69727
[77,] -79.40461 43.69769
[78,] -79.40547 43.69796
[79,] -79.40566 43.69802
[80,] -79.40588 43.69818
[81,] -79.40607 43.69819
[82,] -79.40667 43.69840
[83,] -79.40778 43.69879
[84,] -79.40871 43.69911
[85,] -79.40914 43.69926
[86,] -79.40943 43.69991
[87,] -79.40937 43.69997
[88,] -79.40936 43.70002
[89,] -79.40937 43.70008
[90,] -79.40940 43.70016
[91,] -79.40986 43.70132
[92,] -79.41026 43.70234
[93,] -79.41081 43.70370
[94,] -79.41096 43.70408
Slot "plotOrder":
[1] 1
Slot "labpt":
[1] -79.40359 43.70469
Slot "ID":
[1] "1"
Slot "area":
[1] 0.0001843636
[[3]]
An object of class "Polygons"
Slot "Polygons":
[[1]]
An object of class "Polygon"
Slot "labpt":
[1] -79.39787 43.68786
Slot "area":
[1] 0.0001296877
Slot "hole":
[1] FALSE
Slot "ringDir":
[1] 1
Slot "coords":
[,1] [,2]
[1,] -79.39119 43.68108
[2,] -79.39141 43.68097
[3,] -79.39322 43.68017
[4,] -79.39581 43.67898
[5,] -79.39735 43.67827
[6,] -79.39746 43.67823
[7,] -79.39756 43.67817
[8,] -79.39767 43.67812
[9,] -79.39778 43.67807
[10,] -79.39789 43.67801
[11,] -79.39793 43.67799
[12,] -79.39794 43.67803
[13,] -79.39801 43.67820
[14,] -79.39814 43.67853
[15,] -79.39835 43.67904
[16,] -79.39856 43.67955
[17,] -79.39873 43.67996
[18,] -79.39894 43.68046
[19,] -79.39907 43.68077
[20,] -79.39922 43.68113
[21,] -79.39980 43.68254
[22,] -79.40017 43.68342
[23,] -79.40021 43.68353
[24,] -79.40053 43.68431
[25,] -79.40084 43.68503
[26,] -79.40113 43.68572
[27,] -79.40150 43.68664
[28,] -79.40234 43.68872
[29,] -79.40308 43.69063
[30,] -79.40308 43.69069
[31,] -79.40306 43.69074
[32,] -79.40302 43.69078
[33,] -79.40186 43.69099
[34,] -79.40176 43.69102
[35,] -79.40169 43.69104
[36,] -79.40159 43.69108
[37,] -79.40148 43.69106
[38,] -79.40087 43.69120
[39,] -79.40105 43.69165
[40,] -79.40113 43.69176
[41,] -79.40128 43.69210
[42,] -79.40159 43.69292
[43,] -79.40190 43.69373
[44,] -79.40219 43.69458
[45,] -79.40232 43.69489
[46,] -79.40237 43.69511
[47,] -79.40240 43.69549
[48,] -79.40309 43.69535
[49,] -79.40351 43.69526
[50,] -79.40467 43.69502
[51,] -79.40505 43.69598
[52,] -79.40528 43.69655
[53,] -79.40541 43.69695
[54,] -79.40561 43.69748
[55,] -79.40588 43.69818
[56,] -79.40566 43.69802
[57,] -79.40547 43.69796
[58,] -79.40461 43.69769
[59,] -79.40320 43.69727
[60,] -79.40312 43.69726
[61,] -79.40296 43.69715
[62,] -79.40277 43.69713
[63,] -79.40258 43.69707
[64,] -79.40228 43.69700
[65,] -79.40167 43.69683
[66,] -79.40127 43.69673
[67,] -79.40009 43.69639
[68,] -79.39896 43.69610
[69,] -79.39804 43.69585
[70,] -79.39720 43.69565
[71,] -79.39688 43.69560
[72,] -79.39611 43.69566
[73,] -79.39538 43.69227
[74,] -79.39534 43.69210
[75,] -79.39517 43.69126
[76,] -79.39506 43.69078
[77,] -79.39494 43.69020
[78,] -79.39489 43.69000
[79,] -79.39482 43.68974
[80,] -79.39460 43.68922
[81,] -79.39457 43.68913
[82,] -79.39414 43.68808
[83,] -79.39371 43.68713
[84,] -79.39333 43.68623
[85,] -79.39319 43.68588
[86,] -79.39285 43.68503
[87,] -79.39238 43.68394
[88,] -79.39203 43.68310
[89,] -79.39194 43.68287
[90,] -79.39163 43.68215
[91,] -79.39156 43.68197
[92,] -79.39134 43.68143
[93,] -79.39119 43.68108
Slot "plotOrder":
[1] 1
Slot "labpt":
[1] -79.39787 43.68786
Slot "ID":
[1] "2"
Slot "area":
[1] 0.0001296877
[[4]]
An object of class "Polygons"
Slot "Polygons":
[[1]]
An object of class "Polygon"
Slot "labpt":
[1] -79.48888 43.76574
Slot "area":
[1] 0.001481304
Slot "hole":
[1] FALSE
Slot "ringDir":
[1] 1
Slot "coords":
[,1] [,2]
[1,] -79.50529 43.75987
[2,] -79.50488 43.75996
[3,] -79.50490 43.76011
[4,] -79.50493 43.76021
[5,] -79.50495 43.76027
[6,] -79.50494 43.76041
[7,] -79.50497 43.76056
[8,] -79.50516 43.76062
[9,] -79.50535 43.76060
[10,] -79.50554 43.76066
[11,] -79.50572 43.76061
[12,] -79.50592 43.76055
[13,] -79.50606 43.76062
[14,] -79.50590 43.76069
[15,] -79.50600 43.76080
[16,] -79.50621 43.76084
[17,] -79.50634 43.76076
[18,] -79.50653 43.76073
[19,] -79.50670 43.76066
[20,] -79.50685 43.76075
[21,] -79.50700 43.76085
[22,] -79.50720 43.76079
[23,] -79.50740 43.76081
[24,] -79.50745 43.76096
[25,] -79.50742 43.76113
[26,] -79.50744 43.76131
[27,] -79.50760 43.76145
[28,] -79.50778 43.76158
[29,] -79.50801 43.76164
[30,] -79.50818 43.76168
[31,] -79.50823 43.76178
[32,] -79.50826 43.76183
[33,] -79.50824 43.76193
[34,] -79.50822 43.76197
[35,] -79.50822 43.76200
[36,] -79.50824 43.76206
[37,] -79.50827 43.76212
[38,] -79.50830 43.76218
[39,] -79.50833 43.76221
[40,] -79.50836 43.76222
[41,] -79.50841 43.76221
[42,] -79.50847 43.76218
[43,] -79.50850 43.76220
[44,] -79.50863 43.76221
[45,] -79.50870 43.76228
[46,] -79.50870 43.76228
[47,] -79.50876 43.76243
[48,] -79.50869 43.76255
[49,] -79.50850 43.76262
[50,] -79.50828 43.76265
[51,] -79.50813 43.76271
[52,] -79.50815 43.76274
[53,] -79.50819 43.76279
[54,] -79.50838 43.76277
[55,] -79.50847 43.76284
[56,] -79.50845 43.76298
[57,] -79.50845 43.76299
[58,] -79.50840 43.76315
[59,] -79.50823 43.76328
[60,] -79.50803 43.76333
[61,] -79.50783 43.76330
[62,] -79.50763 43.76324
[63,] -79.50745 43.76324
[64,] -79.50738 43.76333
[65,] -79.50736 43.76349
[66,] -79.50731 43.76364
[67,] -79.50731 43.76378
[68,] -79.50730 43.76393
[69,] -79.50726 43.76406
[70,] -79.50717 43.76421
[71,] -79.50721 43.76440
[72,] -79.50721 43.76448
[73,] -79.50721 43.76460
[74,] -79.50738 43.76475
[75,] -79.50746 43.76494
[76,] -79.50761 43.76507
[77,] -79.50779 43.76518
[78,] -79.50797 43.76530
[79,] -79.50817 43.76543
[80,] -79.50839 43.76552
[81,] -79.50859 43.76563
[82,] -79.50870 43.76573
[83,] -79.50889 43.76576
[84,] -79.50902 43.76585
[85,] -79.50907 43.76601
[86,] -79.50912 43.76616
[87,] -79.50926 43.76630
[88,] -79.50933 43.76647
[89,] -79.50929 43.76661
[90,] -79.50933 43.76677
[91,] -79.50950 43.76685
[92,] -79.50991 43.76675
[93,] -79.50985 43.76696
[94,] -79.50986 43.76708
[95,] -79.51001 43.76715
[96,] -79.51035 43.76715
[97,] -79.51033 43.76727
[98,] -79.51016 43.76728
[99,] -79.51005 43.76734
[100,] -79.51013 43.76751
[101,] -79.51030 43.76758
[102,] -79.51039 43.76751
[103,] -79.51051 43.76750
[104,] -79.51065 43.76761
[105,] -79.51077 43.76776
[106,] -79.51094 43.76788
[107,] -79.51098 43.76802
[108,] -79.51096 43.76817
[109,] -79.51118 43.76821
[110,] -79.51134 43.76831
[111,] -79.51136 43.76847
[112,] -79.51127 43.76863
[113,] -79.51123 43.76878
[114,] -79.51144 43.76883
[115,] -79.51164 43.76885
[116,] -79.51174 43.76893
[117,] -79.51184 43.76907
[118,] -79.51190 43.76921
[119,] -79.51199 43.76916
[120,] -79.51221 43.76919
[121,] -79.51232 43.76934
[122,] -79.51219 43.76964
[123,] -79.51225 43.76980
[124,] -79.51246 43.76991
[125,] -79.51292 43.77001
[126,] -79.51316 43.77003
[127,] -79.51340 43.77007
[128,] -79.51363 43.77012
[129,] -79.51388 43.77013
[130,] -79.51431 43.76999
[131,] -79.51435 43.76996
[132,] -79.51448 43.76986
[133,] -79.51462 43.76968
[134,] -79.51496 43.76947
[135,] -79.51517 43.76961
[136,] -79.51514 43.76973
[137,] -79.51522 43.76986
[138,] -79.51536 43.77000
[139,] -79.51554 43.77001
[140,] -79.51560 43.76992
[141,] -79.51574 43.76995
[142,] -79.51588 43.77003
[143,] -79.51602 43.76998
[144,] -79.51619 43.77009
[145,] -79.51622 43.77013
[146,] -79.51632 43.77025
[147,] -79.51650 43.77041
[148,] -79.51670 43.77059
[149,] -79.51685 43.77093
[150,] -79.51673 43.77099
[151,] -79.51683 43.77112
[152,] -79.51699 43.77126
[153,] -79.51706 43.77143
[154,] -79.51702 43.77165
[155,] -79.51703 43.77184
[156,] -79.51717 43.77195
[157,] -79.51736 43.77206
[158,] -79.51758 43.77218
[159,] -79.51783 43.77227
[160,] -79.51808 43.77241
[161,] -79.51819 43.77262
[162,] -79.51815 43.77282
[163,] -79.51836 43.77286
[164,] -79.51870 43.77309
[165,] -79.51883 43.77323
[166,] -79.51889 43.77340
[167,] -79.51893 43.77357
[168,] -79.51869 43.77377
[169,] -79.51859 43.77384
[170,] -79.51855 43.77395
[171,] -79.51862 43.77409
[172,] -79.51873 43.77413
[173,] -79.51882 43.77403
[174,] -79.51901 43.77396
[175,] -79.51915 43.77399
[176,] -79.51927 43.77406
[177,] -79.51943 43.77412
[178,] -79.51963 43.77426
[179,] -79.51986 43.77434
[180,] -79.52013 43.77439
[181,] -79.52038 43.77443
[182,] -79.52056 43.77452
[183,] -79.52072 43.77461
[184,] -79.52086 43.77474
[185,] -79.52103 43.77487
[186,] -79.52121 43.77498
[187,] -79.52135 43.77504
[188,] -79.52174 43.77547
[189,] -79.52162 43.77550
[190,] -79.52133 43.77555
[191,] -79.52110 43.77562
[192,] -79.52079 43.77570
[193,] -79.52057 43.77575
[194,] -79.52040 43.77578
[195,] -79.52015 43.77582
[196,] -79.51994 43.77586
[197,] -79.51960 43.77590
[198,] -79.51927 43.77595
[199,] -79.51901 43.77598
[200,] -79.51875 43.77602
[201,] -79.51701 43.77636
[202,] -79.51109 43.77772
[203,] -79.50434 43.77924
[204,] -79.50170 43.77987
[205,] -79.49877 43.78056
[206,] -79.49737 43.78090
[207,] -79.49451 43.78158
[208,] -79.49013 43.78257
[209,] -79.48731 43.78322
[210,] -79.48446 43.78389
[211,] -79.48106 43.78470
[212,] -79.47476 43.78618
[213,] -79.47472 43.78619
[214,] -79.47009 43.78728
[215,] -79.47007 43.78679
[216,] -79.47007 43.78646
[217,] -79.47007 43.78610
[218,] -79.47014 43.78404
[219,] -79.47015 43.78384
[220,] -79.47018 43.78292
[221,] -79.47018 43.78273
[222,] -79.47018 43.78263
[223,] -79.47016 43.78241
[224,] -79.47012 43.78219
[225,] -79.47008 43.78196
[226,] -79.47004 43.78178
[227,] -79.46982 43.78084
[228,] -79.46912 43.77794
[229,] -79.46847 43.77519
[230,] -79.46779 43.77236
[231,] -79.46772 43.77208
[232,] -79.46769 43.77196
[233,] -79.46768 43.77192
[234,] -79.46765 43.77178
[235,] -79.46693 43.76885
[236,] -79.46626 43.76581
[237,] -79.46613 43.76522
[238,] -79.46570 43.76329
[239,] -79.46521 43.76104
[240,] -79.46521 43.76102
[241,] -79.46516 43.76089
[242,] -79.46512 43.76079
[243,] -79.46509 43.76062
[244,] -79.46508 43.76055
[245,] -79.46503 43.76028
[246,] -79.46499 43.76001
[247,] -79.46497 43.75970
[248,] -79.46495 43.75947
[249,] -79.46471 43.75895
[250,] -79.46461 43.75854
[251,] -79.46461 43.75852
[252,] -79.46462 43.75849
[253,] -79.46461 43.75844
[254,] -79.46461 43.75840
[255,] -79.46446 43.75775
[256,] -79.46427 43.75694
[257,] -79.46410 43.75613
[258,] -79.46392 43.75529
[259,] -79.46373 43.75449
[260,] -79.46346 43.75331
[261,] -79.46277 43.75038
[262,] -79.46339 43.75025
[263,] -79.46396 43.75014
[264,] -79.46402 43.75014
[265,] -79.46430 43.75011
[266,] -79.46453 43.75014
[267,] -79.46482 43.75018
[268,] -79.46498 43.75021
[269,] -79.46513 43.75026
[270,] -79.46525 43.75029
[271,] -79.46538 43.75034
[272,] -79.46550 43.75039
[273,] -79.46564 43.75046
[274,] -79.46572 43.75051
[275,] -79.46644 43.75119
[276,] -79.46722 43.75192
[277,] -79.46816 43.75282
[278,] -79.46854 43.75320
[279,] -79.46886 43.75348
[280,] -79.46919 43.75373
[281,] -79.46966 43.75403
[282,] -79.46990 43.75418
[283,] -79.47036 43.75437
[284,] -79.47097 43.75461
[285,] -79.47171 43.75490
[286,] -79.47243 43.75518
[287,] -79.47297 43.75538
[288,] -79.47309 43.75541
[289,] -79.47328 43.75545
[290,] -79.47377 43.75552
[291,] -79.47430 43.75553
[292,] -79.47454 43.75554
[293,] -79.47471 43.75553
[294,] -79.47494 43.75551
[295,] -79.47519 43.75547
[296,] -79.47858 43.75470
[297,] -79.47950 43.75449
[298,] -79.48029 43.75432
[299,] -79.48061 43.75424
[300,] -79.48070 43.75422
[301,] -79.48098 43.75415
[302,] -79.48110 43.75412
[303,] -79.48129 43.75405
[304,] -79.48158 43.75390
[305,] -79.48170 43.75383
[306,] -79.48193 43.75369
[307,] -79.48200 43.75365
[308,] -79.48210 43.75355
[309,] -79.48225 43.75344
[310,] -79.48239 43.75330
[311,] -79.48246 43.75323
[312,] -79.48254 43.75313
[313,] -79.48260 43.75306
[314,] -79.48264 43.75302
[315,] -79.48274 43.75285
[316,] -79.48280 43.75273
[317,] -79.48286 43.75252
[318,] -79.48290 43.75240
[319,] -79.48292 43.75221
[320,] -79.48287 43.75080
[321,] -79.48279 43.74829
[322,] -79.48272 43.74771
[323,] -79.48272 43.74754
[324,] -79.48273 43.74735
[325,] -79.48274 43.74719
[326,] -79.48277 43.74698
[327,] -79.48281 43.74682
[328,] -79.48288 43.74664
[329,] -79.48297 43.74638
[330,] -79.48308 43.74623
[331,] -79.48329 43.74598
[332,] -79.48337 43.74591
[333,] -79.48349 43.74580
[334,] -79.48363 43.74567
[335,] -79.48382 43.74557
[336,] -79.48391 43.74549
[337,] -79.48400 43.74544
[338,] -79.48418 43.74534
[339,] -79.48435 43.74527
[340,] -79.48460 43.74516
[341,] -79.48483 43.74508
[342,] -79.48501 43.74504
[343,] -79.48645 43.74478
[344,] -79.48670 43.74474
[345,] -79.48690 43.74471
[346,] -79.48721 43.74467
[347,] -79.48746 43.74461
[348,] -79.48768 43.74456
[349,] -79.48811 43.74447
[350,] -79.48852 43.74438
[351,] -79.48868 43.74434
[352,] -79.48931 43.74420
[353,] -79.49005 43.74404
[354,] -79.49090 43.74386
[355,] -79.49185 43.74365
[356,] -79.49255 43.74348
[357,] -79.49342 43.74329
[358,] -79.49424 43.74311
[359,] -79.49644 43.74264
[360,] -79.49648 43.74263
[361,] -79.49702 43.74252
[362,] -79.49705 43.74258
[363,] -79.49718 43.74275
[364,] -79.49732 43.74290
[365,] -79.49722 43.74311
[366,] -79.49722 43.74333
[367,] -79.49740 43.74349
[368,] -79.49767 43.74348
[369,] -79.49788 43.74360
[370,] -79.49788 43.74379
[371,] -79.49790 43.74402
[372,] -79.49785 43.74422
[373,] -79.49783 43.74440
[374,] -79.49785 43.74462
[375,] -79.49791 43.74482
[376,] -79.49800 43.74502
[377,] -79.49806 43.74526
[378,] -79.49802 43.74550
[379,] -79.49794 43.74570
[380,] -79.49796 43.74591
[381,] -79.49822 43.74606
[382,] -79.49848 43.74617
[383,] -79.49876 43.74624
[384,] -79.49905 43.74634
[385,] -79.49930 43.74643
[386,] -79.49935 43.74645
[387,] -79.49963 43.74654
[388,] -79.49991 43.74657
[389,] -79.50020 43.74663
[390,] -79.50048 43.74669
[391,] -79.50080 43.74679
[392,] -79.50110 43.74689
[393,] -79.50139 43.74698
[394,] -79.50165 43.74705
[395,] -79.50193 43.74712
[396,] -79.50210 43.74730
[397,] -79.50212 43.74750
[398,] -79.50221 43.74767
[399,] -79.50245 43.74780
[400,] -79.50271 43.74791
[401,] -79.50295 43.74800
[402,] -79.50320 43.74806
[403,] -79.50345 43.74813
[404,] -79.50362 43.74829
[405,] -79.50370 43.74848
[406,] -79.50386 43.74863
[407,] -79.50406 43.74875
[408,] -79.50429 43.74887
[409,] -79.50452 43.74902
[410,] -79.50474 43.74915
[411,] -79.50497 43.74927
[412,] -79.50519 43.74939
[413,] -79.50540 43.74950
[414,] -79.50560 43.74964
[415,] -79.50584 43.74969
[416,] -79.50609 43.74969
[417,] -79.50633 43.74963
[418,] -79.50658 43.74966
[419,] -79.50676 43.74978
[420,] -79.50684 43.74995
[421,] -79.50705 43.75001
[422,] -79.50729 43.75000
[423,] -79.50749 43.75011
[424,] -79.50757 43.75029
[425,] -79.50756 43.75045
[426,] -79.50756 43.75047
[427,] -79.50749 43.75062
[428,] -79.50733 43.75068
[429,] -79.50726 43.75079
[430,] -79.50743 43.75089
[431,] -79.50768 43.75086
[432,] -79.50790 43.75081
[433,] -79.50811 43.75083
[434,] -79.50835 43.75090
[435,] -79.50859 43.75094
[436,] -79.50887 43.75098
[437,] -79.50911 43.75102
[438,] -79.50925 43.75102
[439,] -79.50938 43.75108
[440,] -79.50954 43.75116
[441,] -79.50966 43.75128
[442,] -79.50974 43.75147
[443,] -79.50984 43.75169
[444,] -79.50991 43.75189
[445,] -79.50994 43.75208
[446,] -79.50998 43.75228
[447,] -79.51003 43.75249
[448,] -79.50996 43.75266
[449,] -79.50985 43.75280
[450,] -79.50975 43.75295
[451,] -79.50962 43.75298
[452,] -79.50946 43.75300
[453,] -79.50935 43.75310
[454,] -79.50946 43.75321
[455,] -79.50950 43.75332
[456,] -79.50963 43.75343
[457,] -79.50962 43.75349
[458,] -79.50961 43.75354
[459,] -79.50968 43.75367
[460,] -79.50966 43.75381
[461,] -79.50945 43.75386
[462,] -79.50923 43.75390
[463,] -79.50901 43.75389
[464,] -79.50882 43.75388
[465,] -79.50866 43.75393
[466,] -79.50849 43.75401
[467,] -79.50827 43.75406
[468,] -79.50808 43.75410
[469,] -79.50800 43.75419
[470,] -79.50796 43.75434
[471,] -79.50792 43.75450
[472,] -79.50789 43.75465
[473,] -79.50783 43.75480
[474,] -79.50764 43.75512
[475,] -79.50755 43.75531
[476,] -79.50745 43.75547
[477,] -79.50732 43.75563
[478,] -79.50715 43.75578
[479,] -79.50691 43.75585
[480,] -79.50682 43.75600
[481,] -79.50667 43.75628
[482,] -79.50649 43.75634
[483,] -79.50626 43.75633
[484,] -79.50607 43.75643
[485,] -79.50624 43.75651
[486,] -79.50667 43.75667
[487,] -79.50675 43.75679
[488,] -79.50670 43.75685
[489,] -79.50666 43.75691
[490,] -79.50662 43.75694
[491,] -79.50658 43.75700
[492,] -79.50655 43.75705
[493,] -79.50651 43.75708
[494,] -79.50645 43.75714
[495,] -79.50638 43.75718
[496,] -79.50632 43.75722
[497,] -79.50626 43.75725
[498,] -79.50621 43.75726
[499,] -79.50613 43.75729
[500,] -79.50612 43.75729
[ reached getOption("max.print") -- omitted 30 rows ]
Slot "plotOrder":
[1] 1
Slot "labpt":
[1] -79.48888 43.76574
Slot "ID":
[1] "3"
Slot "area":
[1] 0.001481304
[[5]]
An object of class "Polygons"
Slot "Polygons":
[[1]]
An object of class "Polygon"
Slot "labpt":
[1] -79.45711 43.71467
Slot "area":
[1] 0.0006746505
Slot "hole":
[1] FALSE
Slot "ringDir":
[1] 1
Slot "coords":
[,1] [,2]
[1,] -79.43969 43.70561
[2,] -79.44011 43.70559
[3,] -79.44102 43.70541
[4,] -79.44228 43.70518
[5,] -79.44485 43.70461
[6,] -79.44727 43.70407
[7,] -79.44918 43.70365
[8,] -79.45226 43.70297
[9,] -79.45639 43.70205
[10,] -79.46037 43.70115
[11,] -79.46396 43.70036
[12,] -79.46710 43.69967
[13,] -79.46786 43.70226
[14,] -79.46791 43.70246
[15,] -79.46797 43.70266
[16,] -79.46803 43.70286
[17,] -79.46809 43.70306
[18,] -79.46814 43.70327
[19,] -79.46820 43.70347
[20,] -79.46825 43.70367
[21,] -79.46830 43.70387
[22,] -79.46836 43.70407
[23,] -79.46841 43.70427
[24,] -79.46846 43.70447
[25,] -79.46851 43.70468
[26,] -79.46852 43.70472
[27,] -79.46856 43.70488
[28,] -79.46861 43.70508
[29,] -79.46865 43.70528
[30,] -79.46870 43.70548
[31,] -79.46875 43.70569
[32,] -79.46879 43.70589
[33,] -79.46884 43.70609
[34,] -79.46888 43.70629
[35,] -79.46935 43.70868
[36,] -79.46978 43.71080
[37,] -79.46982 43.71100
[38,] -79.47011 43.71242
[39,] -79.47090 43.71644
[40,] -79.47175 43.72076
[41,] -79.47207 43.72237
[42,] -79.47230 43.72355
[43,] -79.47249 43.72450
[44,] -79.47253 43.72469
[45,] -79.47257 43.72487
[46,] -79.47179 43.72506
[47,] -79.47157 43.72512
[48,] -79.47135 43.72517
[49,] -79.47114 43.72522
[50,] -79.47092 43.72527
[51,] -79.47070 43.72532
[52,] -79.47048 43.72537
[53,] -79.47026 43.72542
[54,] -79.47004 43.72547
[55,] -79.46982 43.72551
[56,] -79.46960 43.72556
[57,] -79.46938 43.72561
[58,] -79.46916 43.72565
[59,] -79.46615 43.72628
[60,] -79.46268 43.72703
[61,] -79.45789 43.72807
[62,] -79.45785 43.72807
[63,] -79.45670 43.72832
[64,] -79.45154 43.72944
[65,] -79.44928 43.72993
[66,] -79.44911 43.72997
[67,] -79.44910 43.72997
[68,] -79.44892 43.73000
[69,] -79.44890 43.73001
[70,] -79.44882 43.73002
[71,] -79.44875 43.73004
[72,] -79.44855 43.73008
[73,] -79.44851 43.72989
[74,] -79.44851 43.72984
[75,] -79.44848 43.72969
[76,] -79.44846 43.72957
[77,] -79.44810 43.72741
[78,] -79.44808 43.72733
[79,] -79.44807 43.72725
[80,] -79.44806 43.72718
[81,] -79.44805 43.72710
[82,] -79.44803 43.72703
[83,] -79.44802 43.72695
[84,] -79.44800 43.72687
[85,] -79.44798 43.72680
[86,] -79.44797 43.72672
[87,] -79.44795 43.72665
[88,] -79.44793 43.72657
[89,] -79.44791 43.72650
[90,] -79.44789 43.72642
[91,] -79.44787 43.72634
[92,] -79.44784 43.72627
[93,] -79.44782 43.72619
[94,] -79.44781 43.72614
[95,] -79.44780 43.72608
[96,] -79.44779 43.72603
[97,] -79.44777 43.72597
[98,] -79.44776 43.72592
[99,] -79.44775 43.72586
[100,] -79.44774 43.72584
[101,] -79.44774 43.72583
[102,] -79.44773 43.72580
[103,] -79.44771 43.72575
[104,] -79.44770 43.72570
[105,] -79.44770 43.72569
[106,] -79.44768 43.72564
[107,] -79.44766 43.72558
[108,] -79.44764 43.72553
[109,] -79.44762 43.72548
[110,] -79.44760 43.72542
[111,] -79.44758 43.72537
[112,] -79.44756 43.72531
[113,] -79.44754 43.72526
[114,] -79.44751 43.72520
[115,] -79.44749 43.72515
[116,] -79.44746 43.72510
[117,] -79.44744 43.72504
[118,] -79.44741 43.72499
[119,] -79.44736 43.72483
[120,] -79.44730 43.72467
[121,] -79.44730 43.72466
[122,] -79.44724 43.72451
[123,] -79.44718 43.72436
[124,] -79.44712 43.72420
[125,] -79.44706 43.72404
[126,] -79.44700 43.72388
[127,] -79.44691 43.72366
[128,] -79.44627 43.72213
[129,] -79.44518 43.71921
[130,] -79.44510 43.71898
[131,] -79.44434 43.71692
[132,] -79.44402 43.71614
[133,] -79.44380 43.71560
[134,] -79.44343 43.71470
[135,] -79.44340 43.71465
[136,] -79.44280 43.71301
[137,] -79.44271 43.71280
[138,] -79.44242 43.71212
[139,] -79.44237 43.71200
[140,] -79.44232 43.71189
[141,] -79.44226 43.71178
[142,] -79.44221 43.71166
[143,] -79.44215 43.71155
[144,] -79.44210 43.71144
[145,] -79.44204 43.71132
[146,] -79.44202 43.71128
[147,] -79.44198 43.71121
[148,] -79.44192 43.71110
[149,] -79.44187 43.71099
[150,] -79.44180 43.71087
[151,] -79.44174 43.71077
[152,] -79.44168 43.71065
[153,] -79.44099 43.70960
[154,] -79.43987 43.70790
[155,] -79.43929 43.70702
[156,] -79.43920 43.70689
[157,] -79.43912 43.70675
[158,] -79.43903 43.70661
[159,] -79.43894 43.70648
[160,] -79.43885 43.70634
[161,] -79.43876 43.70620
[162,] -79.43867 43.70607
[163,] -79.43863 43.70600
[164,] -79.43859 43.70593
[165,] -79.43855 43.70587
[166,] -79.43854 43.70586
[167,] -79.43878 43.70581
[168,] -79.43903 43.70576
[169,] -79.43969 43.70561
Slot "plotOrder":
[1] 1
Slot "labpt":
[1] -79.45711 43.71467
Slot "ID":
[1] "4"
Slot "area":
[1] 0.0006746505
[[6]]
An object of class "Polygons"
Slot "Polygons":
[[1]]
An object of class "Polygon"
Slot "labpt":
[1] -79.49605 43.65742
Slot "area":
[1] 0.0001989016
Slot "hole":
[1] FALSE
Slot "ringDir":
[1] 1
Slot "coords":
[,1] [,2]
[1,] -79.50552 43.66281
[2,] -79.50577 43.66291
[3,] -79.50617 43.66301
[4,] -79.50660 43.66302
[5,] -79.50709 43.66291
[6,] -79.50750 43.66279
[7,] -79.50794 43.66262
[8,] -79.50837 43.66248
[9,] -79.50884 43.66231
[10,] -79.50929 43.66212
[11,] -79.50978 43.66200
[12,] -79.51025 43.66194
[13,] -79.51058 43.66197
[14,] -79.51098 43.66205
[15,] -79.51108 43.66207
[16,] -79.51130 43.66212
[17,] -79.51149 43.66220
[18,] -79.51154 43.66222
[19,] -79.51169 43.66231
[20,] -79.51175 43.66234
[21,] -79.51184 43.66239
[22,] -79.51196 43.66245
[23,] -79.51198 43.66247
[24,] -79.51201 43.66249
[25,] -79.51213 43.66257
[26,] -79.51221 43.66263
[27,] -79.51172 43.66302
[28,] -79.51154 43.66319
[29,] -79.51135 43.66335
[30,] -79.51115 43.66355
[31,] -79.51093 43.66370
[32,] -79.51068 43.66388
[33,] -79.51038 43.66408
[34,] -79.51012 43.66424
[35,] -79.50998 43.66433
[36,] -79.50968 43.66448
[37,] -79.50938 43.66463
[38,] -79.50907 43.66478
[39,] -79.50878 43.66489
[40,] -79.50856 43.66497
[41,] -79.50841 43.66501
[42,] -79.50814 43.66509
[43,] -79.50779 43.66518
[44,] -79.50762 43.66522
[45,] -79.50739 43.66526
[46,] -79.50717 43.66530
[47,] -79.50685 43.66534
[48,] -79.50654 43.66539
[49,] -79.50623 43.66542
[50,] -79.50596 43.66545
[51,] -79.50562 43.66547
[52,] -79.50022 43.66581
[53,] -79.50015 43.66581
[54,] -79.50007 43.66581
[55,] -79.50000 43.66581
[56,] -79.49993 43.66581
[57,] -79.49986 43.66581
[58,] -79.49979 43.66582
[59,] -79.49971 43.66582
[60,] -79.49964 43.66583
[61,] -79.49957 43.66583
[62,] -79.49950 43.66583
[63,] -79.49943 43.66584
[64,] -79.49935 43.66585
[65,] -79.49928 43.66586
[66,] -79.49923 43.66586
[67,] -79.49923 43.66581
[68,] -79.49921 43.66552
[69,] -79.49861 43.66561
[70,] -79.49855 43.66550
[71,] -79.49843 43.66541
[72,] -79.49773 43.66492
[73,] -79.49764 43.66487
[74,] -79.49753 43.66485
[75,] -79.49725 43.66478
[76,] -79.49702 43.66473
[77,] -79.49685 43.66469
[78,] -79.49664 43.66462
[79,] -79.49645 43.66453
[80,] -79.49629 43.66442
[81,] -79.49617 43.66428
[82,] -79.49604 43.66403
[83,] -79.49596 43.66392
[84,] -79.49563 43.66367
[85,] -79.49551 43.66359
[86,] -79.49532 43.66338
[87,] -79.49508 43.66314
[88,] -79.49499 43.66302
[89,] -79.49481 43.66288
[90,] -79.49474 43.66279
[91,] -79.49470 43.66269
[92,] -79.49463 43.66256
[93,] -79.49460 43.66245
[94,] -79.49459 43.66235
[95,] -79.49459 43.66223
[96,] -79.49456 43.66199
[97,] -79.49454 43.66187
[98,] -79.49453 43.66179
[99,] -79.49448 43.66165
[100,] -79.49441 43.66155
[101,] -79.49436 43.66149
[102,] -79.49432 43.66143
[103,] -79.49427 43.66133
[104,] -79.49423 43.66124
[105,] -79.49422 43.66112
[106,] -79.49421 43.66103
[107,] -79.49423 43.66093
[108,] -79.49425 43.66083
[109,] -79.49428 43.66071
[110,] -79.49430 43.66069
[111,] -79.49438 43.66054
[112,] -79.49445 43.66044
[113,] -79.49453 43.66036
[114,] -79.49462 43.66026
[115,] -79.49538 43.65977
[116,] -79.49552 43.65970
[117,] -79.49527 43.65952
[118,] -79.49508 43.65941
[119,] -79.49497 43.65938
[120,] -79.49433 43.65945
[121,] -79.49381 43.65952
[122,] -79.49281 43.65960
[123,] -79.49263 43.65964
[124,] -79.49149 43.65990
[125,] -79.49027 43.66016
[126,] -79.48903 43.66041
[127,] -79.48885 43.66002
[128,] -79.48879 43.65980
[129,] -79.48850 43.65914
[130,] -79.48830 43.65869
[131,] -79.48819 43.65845
[132,] -79.48812 43.65827
[133,] -79.48796 43.65787
[134,] -79.48771 43.65723
[135,] -79.48726 43.65610
[136,] -79.48711 43.65574
[137,] -79.48698 43.65539
[138,] -79.48670 43.65470
[139,] -79.48641 43.65401
[140,] -79.48597 43.65295
[141,] -79.48569 43.65225
[142,] -79.48545 43.65166
[143,] -79.48539 43.65152
[144,] -79.48514 43.65091
[145,] -79.48482 43.65016
[146,] -79.48448 43.64933
[147,] -79.48458 43.64928
[148,] -79.48467 43.64924
[149,] -79.48474 43.64919
[150,] -79.48491 43.64908
[151,] -79.48508 43.64908
[152,] -79.48611 43.64885
[153,] -79.48623 43.64891
[154,] -79.48633 43.64896
[155,] -79.48652 43.64876
[156,] -79.48747 43.64856
[157,] -79.48890 43.64825
[158,] -79.49034 43.64793
[159,] -79.49262 43.64744
[160,] -79.49242 43.64786
[161,] -79.49227 43.64810
[162,] -79.49204 43.64839
[163,] -79.49197 43.64847
[164,] -79.49178 43.64871
[165,] -79.49154 43.64906
[166,] -79.49129 43.64938
[167,] -79.49102 43.64968
[168,] -79.49088 43.65005
[169,] -79.49093 43.65045
[170,] -79.49096 43.65054
[171,] -79.49109 43.65087
[172,] -79.49124 43.65126
[173,] -79.49136 43.65143
[174,] -79.49150 43.65163
[175,] -79.49196 43.65191
[176,] -79.49248 43.65212
[177,] -79.49306 43.65226
[178,] -79.49365 43.65231
[179,] -79.49427 43.65229
[180,] -79.49484 43.65220
[181,] -79.49544 43.65210
[182,] -79.49602 43.65206
[183,] -79.49638 43.65201
[184,] -79.49665 43.65198
[185,] -79.49725 43.65197
[186,] -79.49777 43.65198
[187,] -79.49786 43.65199
[188,] -79.49847 43.65206
[189,] -79.49907 43.65212
[190,] -79.49972 43.65214
[191,] -79.50034 43.65217
[192,] -79.50094 43.65227
[193,] -79.50152 43.65240
[194,] -79.50207 43.65258
[195,] -79.50249 43.65288
[196,] -79.50278 43.65321
[197,] -79.50287 43.65363
[198,] -79.50286 43.65405
[199,] -79.50279 43.65445
[200,] -79.50269 43.65480
[201,] -79.50263 43.65491
[202,] -79.50251 43.65514
[203,] -79.50225 43.65547
[204,] -79.50194 43.65579
[205,] -79.50161 43.65608
[206,] -79.50123 43.65636
[207,] -79.50082 43.65663
[208,] -79.50040 43.65687
[209,] -79.50003 43.65717
[210,] -79.49974 43.65753
[211,] -79.49956 43.65786
[212,] -79.49953 43.65791
[213,] -79.49946 43.65820
[214,] -79.49944 43.65830
[215,] -79.49952 43.65869
[216,] -79.49978 43.65904
[217,] -79.50014 43.65934
[218,] -79.50061 43.65956
[219,] -79.50105 43.65977
[220,] -79.50141 43.65997
[221,] -79.50148 43.66000
[222,] -79.50191 43.66028
[223,] -79.50229 43.66056
[224,] -79.50246 43.66068
[225,] -79.50269 43.66085
[226,] -79.50308 43.66112
[227,] -79.50345 43.66141
[228,] -79.50375 43.66170
[229,] -79.50409 43.66195
[230,] -79.50420 43.66200
[231,] -79.50447 43.66214
[232,] -79.50486 43.66234
[233,] -79.50514 43.66255
[234,] -79.50540 43.66275
[235,] -79.50552 43.66281
Slot "plotOrder":
[1] 1
Slot "labpt":
[1] -79.49605 43.65742
Slot "ID":
[1] "5"
Slot "area":
[1] 0.0001989016
Slot "plotOrder":
[1] 4 5 6 1 2 3
Slot "bbox":
min max
x -79.52174 -79.39119
y 43.64744 43.78728
Slot "proj4string":
CRS arguments:
+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0
From Simply Analytics i have downloaded shapefiles containing average income by census track and subdivision. These two shapefiles will usefull in drilling down beyond the neighbourhood. Both shapefiles can be uploaded into a spatial dataframe using the st_read command from the “sf” package we installed earlier then converting them to a SpatialPolygonsDataFrame.
cen_shp1 <- st_read("datasets/SimplyAnalytics_C1/C1.shp")
Reading layer `C1' from data source `C:\Users\gvs_j\Documents\GitHub\CSDA-1050F18S1\JacobGVS_304292\sprint_1\Datasets\SimplyAnalytics_C1\C1.shp' using driver `ESRI Shapefile'
Simple feature collection with 572 features and 4 fields
geometry type: POLYGON
dimension: XY
bbox: xmin: -79.6393 ymin: 43.56034 xmax: -79.11347 ymax: 43.85547
epsg (SRID): 4326
proj4string: +proj=longlat +datum=WGS84 +no_defs
cen_spgdf1 <- as(cen_shp1, "Spatial")
class(cen_spgdf1)
[1] "SpatialPolygonsDataFrame"
attr(,"package")
[1] "sp"
cen_shp2 <- st_read("datasets/SimplyAnalytics_C2/C2.shp")
Reading layer `C2' from data source `C:\Users\gvs_j\Documents\GitHub\CSDA-1050F18S1\JacobGVS_304292\sprint_1\Datasets\SimplyAnalytics_C2\C2.shp' using driver `ESRI Shapefile'
Simple feature collection with 3702 features and 5 fields
geometry type: POLYGON
dimension: XY
bbox: xmin: -79.6393 ymin: 43.56034 xmax: -79.11347 ymax: 43.85547
epsg (SRID): 4326
proj4string: +proj=longlat +datum=WGS84 +no_defs
cen_spgdf2 <- as(cen_shp2, "Spatial")
class(cen_spgdf2)
[1] "SpatialPolygonsDataFrame"
attr(,"package")
[1] "sp"
One additional datatable may be needed depending on how we choose to cluster the KSI data. At a high level grouping accidents to a given neighbourhood as defined by the city then using the census data to further cluster by census track and subdivision will be ideal. I may need to pull the Neighbourhood Profiles data set from the city of Toronto to get an average income level by neighbourhood as this does not appear to be avaialble directly from the census datasets.
With our datasets downloaded we can start by looking through the data. Becasue we are dealing almost exclusively with spatial data the easiest way to get a handle on the data is by mapping it. To do this I will be using features from the “leaflet” package.
Lets satrt by getting an idea of where accidents are occuring. The leaflet package will map the data for us. To make this more readable I have had the system autocluster the accidents. These clusters don’t have any relation to specific neighbourhoods and will need to be adjusted later so that the clusters are in line with our other datasets.
leaflet(ksi_merged) %>%
addTiles() %>%
addMarkers(lng = ksi_merged$LONGITUDE, lat = ksi_merged$LATITUDE, clusterOptions = markerClusterOptions())
This map will allow you to zoom in and the clusters will auto adjust as you zoom in and out. These clusters are based on proximity to a central point. Once you get to the lowest zoom levels, clicking on a cluster will map the individual accidents. Details for each accident are not currenlty included in the mapping.
Our next dataset contains the boundary lines for various neighbourhoods in Toronto. mapping this will begin to give some dimension to how we intend to cluster accidents going forward.
leaflet(nbh) %>%
addTiles() %>%
addPolygons()
We can similarly plot both the census tract and dissemination area files pulled from Simply Analytics.
leaflet(cen_spgdf1) %>%
addTiles() %>%
addPolygons()
leaflet(cen_spgdf2) %>%
addTiles() %>%
addPolygons()
Our next step will be to assing each accident in the KSI data to a dissemination area polygon.